
package ConversorBase;


public class ConversorBinario {
    
private int numDec;
private String numHex;
private String numOct;
private String numBin;



public ConversorBinario(){}


public String converteDecimal(){
	numBin = Integer.toString(numDec, 2);
	return numBin;
}

public String converteHexadecimal(){
    numDec = Integer.parseInt(numHex, 16); 
    numBin = Integer.toString(numDec, 2);
    return numBin;
}

public String converteOctal(){
    numDec = Integer.parseInt(numOct, 8);
    numBin = Integer.toString(numDec, 2);
    return numBin;
}


    public int getNumDec() {
        return numDec;
    }

    /**
     * @param numDec the numDec to set
     */
    public void setNumDec(int numDec) {
        this.numDec = numDec;
    }

    /**
     * @return the valorBin
     */
    public String getNumBin() {
        return numBin;
    }

    /**
     * @param valorBin the valorBin to set
     */
    public void setNumBin(String numBin) {
        this.numBin = numBin;
    }

    /**
     * @return the numHex
     */
    public String getNumHex() {
        return numHex;
    }

    /**
     * @param numHex the numHex to set
     */
    public void setNumHex(String numHex) {
        this.numHex = numHex;
    }

    /**
     * @return the numOct
     */
    public String getNumOct() {
        return numOct;
    }

    /**
     * @param numOct the numOct to set
     */
    public void setNumOct(String numOct) {
        this.numOct = numOct;
    }
}
